package org.yelongframework.model.support.mybatis.service.factory;

import org.yelongframework.model.service.configuration.ModelServiceConfiguration;
import org.yelongframework.model.support.mybatis.service.DefaultMybatisModelService;
import org.yelongframework.model.support.mybatis.service.MybatisModelService;
import org.yelongframework.model.support.mybatis.service.MybatisModelServiceConfiguration;

/**
 * 默认mybatis模型业务工厂实现
 * 
 * @since 1.0.0
 */
public class DefaultMybatisModelServiceFactory implements MybatisModelServiceFactory {

	@Override
	public MybatisModelService create(ModelServiceConfiguration modelServiceConfiguration) {
		if (modelServiceConfiguration instanceof MybatisModelServiceConfiguration) {
			return new DefaultMybatisModelService((MybatisModelServiceConfiguration) modelServiceConfiguration);
		}
		throw new UnsupportedOperationException("mybatisModelService仅支持MybatisModelServiceConfiguration");
	}
}
